public class Singleton {
  //单例模式：饿汉模式

    private Singleton(){

    }
    private static Singleton singleton=new Singleton();//设为static,类在加载时就已经实例化
    public static Singleton getInstance(){
        return singleton;
    }
}
